<input type="hidden" id="new_album_status" value="<?php echo $this->session->flashdata('new_album_status'); ?>" />
<input type="hidden" id="new_album_msg" value="<?php echo $this->session->flashdata('new_album_msg'); ?>" />
<script type="text/javascript">
  $(document).ready(function() {
    var new_album_status = $.trim($('#new_album_status').val());
    var new_album_msg = $.trim($('#new_album_msg').val());
    if (new_album_msg) {
      toastr.error(new_album_msg);
      return false;
    } else if (new_album_status == 3) {
      toastr.error('Error occured. Try again !');
      return false;
    }
  });
</script>

<div class="page" style="min-height: 500px;">
  <div class="page-container">
    <div class="container">
      <div class="row">
        <div class="span12 header">
          <div class="btn-group" style="float: right; margin-bottom: 10px;">
            <a href="<?php echo base_url('albums'); ?>" class="btn">View albums</a>
          </div>
          <h4>Create album</h4>
        </div>
        <div class="span6">
          <form method="post" action="<?php echo base_url('album/create'); ?>" class="form-horizontal" onsubmit="return confirm_action('Save & publish album ?');" enctype="multipart/form-data">
            <input type="hidden" name="csrf_token" value="<?php echo set_csrf_token(); ?>"/>
            <div class="control-group">
              <label class="control-label">Album name </label>
              <div class="controls">
                <input name="album_name" id="album_name" type="text" style="width: 150%;" placeholder="Enter album name (250)" value="<?php echo $album_name; ?>" maxlength="250"/>
              </div>
            </div>
            <div class="control-group">
              <label class="control-label">Album photos </label>
              <div class="controls">
                <input name="album_image[]" id="album_image" type="file" multiple="multiple" accept="image/*"/>
              </div>
            </div>
            <div class="control-group">
              <label class="control-label">Publish album</label>
              <div class="controls">
                <input value="1" style="vertical-align: middle;" name="album_status" id="album_status" type="checkbox" checked="checked"/>
              </div>
            </div>
            <div class="control-group"> 
              <div class="controls">
                <button type="submit" class="btn" onclick="return validate_album();">Create</button>
                <span id="loading_div" style="display: none; color: #0088CC">
                  <img src="<?php echo site_url('assets/img/loading_animation.gif'); ?>"/>&nbsp;Please wait ...&nbsp;
                </span>
              </div>
            </div>
            <div class="control-group">
              <div class="controls">
                <div class="text-info" style="width: 500px;">
                  # You can choose multiple photos or videos by holding ctrl or shift key<br/>
                  # And can select maximum <b><?php echo ini_get('max_file_uploads'); ?></b> files of total size <b><?php echo ini_get('post_max_size'); ?></b><br/>
                </div>
              </div>
            </div>
          </form>
        </div>
      </div>
    </div>
  </div>
</div>